const commonCofig = require('./webpack.common.js');
const merge = require('webpack-merge');
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');

module.exports = merge(commonCofig, {
  mode: 'development',
  devtool: 'cheap-module-eval-source-map',
  output: {
    filename: '[name].js',
    path: path.join(__dirname, 'dist'),
  },
  devServer: {
    contentBase: './public',
    hot: true,
  },
  plugins: [
    new HtmlWebpackPlugin({
      title: '吴博的webpack作业',
      favicon: './public/favicon.ico',
      template: './public/index.html'
    }),
  ]
})